<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dessert House - 店员</title>
<link href="/ChristineCake/css/Management_NoList_Button.css"
	rel="stylesheet" type="text/css" />
</head>

<body>

	<div id="header">
		<div id="logo">
			<img src="/ChristineCake/image/logo.png" alt="logo" width="100%"
				height="100%" />
		</div>
		<div id="logout" align="right">
			<a href="/ChristineCake/jsp/LogIn.jsp">登出</a>
		</div>
	</div>

	<div id="menu">
		<ul>
			<li><a
				href="
			<%out.println("/ChristineCake/SaleGoodsServlet?name="
					+ request.getParameter("name"));%>
			">销售</a></li>
			<li><a
				href="
			<%out.println("/ChristineCake/GoodsManagementServlet?name="
					+ request.getParameter("name"));%>
			">产品管理</a></li>
		</ul>
	</div>

	<div id="panel">
		<jsp:useBean id="goodsList" type="bean.GoodsListBean" scope="request" />
		<jsp:useBean id="goods" class="model.Goods" scope="page" />

		<div id="content">
			<table>
				<tr>
					<td>
						<div id="scroll">
							<table>
								<tr>
									<th>产品编号</th>
									<th>产品名称</th>
									<th>价格</th>
									<th>数量</th>
									<th>日期</th>
									<th>修改</th>
									<th>删除</th>
								</tr>
								<%
									for (int i = 0; i < goodsList.getGoodsList().size(); i++) {
										pageContext.setAttribute("goods", goodsList.getGoods(i));
								%>
								<tr>
									<td><jsp:getProperty name="goods" property="id" /></td>
									<td><jsp:getProperty name="goods" property="name" /></td>
									<td><jsp:getProperty name="goods" property="price" /></td>
									<td><jsp:getProperty name="goods" property="quantity" /></td>
									<td><jsp:getProperty name="goods" property="date" /></td>
									<td><a
										href="/ChristineCake/ModifyGoodsServlet?id=<jsp:getProperty name="goods" property="id" />&date=<jsp:getProperty name="goods" property="date" />
										<%out.println("&name=" + request.getParameter("name"));%>
										">修改</a></td>
									<td><a
										href="/ChristineCake/DeleteGoodsServlet?id=<jsp:getProperty name="goods" property="id" />&date=<jsp:getProperty name="goods" property="date" />
										<%out.println("&name=" + request.getParameter("name"));%>
										">删除</a></td>
								</tr>
								<%
									}
								%>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
		<br />
		<div id="submit" align="center">
			<a
				href="/ChristineCake/AddGoodsServlet
			<%out.println("?name=" + request.getParameter("name"));%>
			">新增</a>
		</div>
	</div>

	<hr />

	<div id="footer">
		<p>©南京大学软件学院 李冰洁</p>
	</div>

</body>

</html>